$(function(){
    $.ajax({
        url:url+'admin/menu',
        type:"GET",
        success:function(datas){
            var data = datas.data;
            var html = '';
            for ( var i=0;i<=data.length-1;i++){
                var sM ='';
                if(data[i].sMenu != null){
                    for(var l=0;l<=data[i].sMenu.length-1;l++){
                        sM +=
                            "<input type='checkbox' id='awesome"+data[i].sMenu[l].menu_id+"' name='menu[]' value='"+data[i].sMenu[l].menu_id+"'/>"+
                            "<label class='fM' for='awesome"+data[i].sMenu[l].menu_id+"'>"+data[i].sMenu[l].title+"</label>"
                    }
                }
                html +=
                    "<div>"+
                    "<input type='checkbox' id='awesome"+data[i].menu_id+"' name='menu[]' value='"+data[i].menu_id+"'/>"+
                    "<label for='awesome"+data[i].menu_id+"'>"+data[i].title+"↓</label>"+
                    "</div>"+
                    "<div>"+
                    sM +
                    "</div>"+
                    "<hr>";
            }
            $('#layui-input-block').html(html);
        }
    })
});